<?php
class ModelDropdown extends Dropdown
{
	function __construct($name, $value, $valueTable, $valueField = 'nefub_id', array $where = array(), $orderBy = 'name', $direction = 'ASC', $limit = null)
	{
		parent::__construct($name, (int)$value);
		
		$rows = Database::select_rows($valueTable, $where, $orderBy, $limit, $direction);
		$this->addOption('Geen', 0);
		
		foreach ($rows as $row)
		{
			$this->addOption($row['name'], $row[$valueField]);
		}
		
	}
}